<template>
    <div class="head">
        <div class="title">
            <h3>Random后台管理系统</h3>
        </div>

        <div class="admin-info" v-show="hasLogin">
            <a @click="logout">注销</a>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            userInfo: null,
        }
    },
    computed:{
        hasLogin(){
            return sessionStorage.getItem('token') != null
        }
    },  
    methods:{
        logout(){
            sessionStorage.removeItem("token")

            this.$router.push({name: 'user'})
        }
    }
}
</script>

<style scoped>
.head {
    padding: 0px 10px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background-color: white;
    box-shadow: 0px 3px 10px gray ;
    margin-bottom: 10px;
}

.title img{
    width:50px;
    height:50px;
}
</style>